/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model;

import java.io.Serializable;
import java.sql.Blob;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.bspv.pharma.common.constant.Constants;

/**
 * @author guillaume
 */
@Entity
@Table(name = "DOCUMENT")
public class Document implements Serializable {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = -668333759309921199L;

    /**
     * Identifiant du document.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * Type mime du document.
     */
    @NotNull
    @Size(max = Constants.CONSTRAINT_MIME_TYPE_SIZE)
    private String mimeType;
    /**
     * Libellé du document.
     */
    @NotNull
    @Size(max = Constants.CONSTRAINT_LONG_LABEL_SIZE)
    private String label;
    /**
     * Commentaire pour ce document.
     */
    @Size(max = Constants.CONSTRAINT_COMMENT_SIZE)
    private String comment;
    /**
     * Données.
     */
    @Lob
    private Blob data;
    /**
     * Numéro de version.
     */
    @Version
    private Integer version;

    /**
     * @return the id
     */
    public final Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public final void setId(final Long id) {
        this.id = id;
    }

    /**
     * @return the mimeType
     */
    public final String getMimeType() {
        return mimeType;
    }

    /**
     * @param mimeType
     *            the mimeType to set
     */
    public final void setMimeType(final String mimeType) {
        this.mimeType = mimeType;
    }

    /**
     * @return the label
     */
    public final String getLabel() {
        return label;
    }

    /**
     * @param label
     *            the label to set
     */
    public final void setLabel(final String label) {
        this.label = label;
    }

    /**
     * @return the comment
     */
    public final String getComment() {
        return comment;
    }

    /**
     * @param comment
     *            the comment to set
     */
    public final void setComment(final String comment) {
        this.comment = comment;
    }

    /**
     * @return the data
     */
    public final Blob getData() {
        return data;
    }

    /**
     * @param data
     *            the data to set
     */
    public final void setData(final Blob data) {
        this.data = data;
    }

    /**
     * @return the version
     */
    public final Integer getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public final void setVersion(final Integer version) {
        this.version = version;
    }

}
